<template>
	<div class="newsinfo-container">
		<h3 class="title">{{items.title}}</h3>
		<p class="subtitle">
			<span>发表时间: {{items.create_at | dataFormat('YYYY-MM-DD')}} </span>
			<span>点击次数: 0次</span>
		</p>
		<hr />
		<div class="content" v-html="items.content">
			
		</div>
	</div>
	
</template>

<script>
export default {
	data() {
		return {
			id: this.$route.params.id,
			items: []
		}
	},
	created() {
		this.getNewInfo();
	},
	methods:{
		getNewInfo() {
			this.$http.get("https://cnodejs.org/api/v1/topic/" + this.id, {
					params: { //参数
						page: this.page,
						
					},
				}).then(res => { //请求成功后的处理函数     
					this.isLoading = false;
					this.items = res.data.data;
					console.log(this.items);
				}).catch(err => { //请求失败后的处理函数   
					console.log(err)
				})
			}
		}
	}

</script>

<style>
	.newsinfo-container{
		padding: 0 5px;
	}
	.title{
		margin: 15px 0;
		text-align: center;
		font-size: 16px;
		color: red;
	}
	.subtitle{
		display: flex;
		justify-content: space-between;
		font-size: 13px;
		color: #007AFF;
	}
	.content{}
</style>
